import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: '主页',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/layout'),
    redirect:'/home',
    children:[
      {
        path: '/home',
        name: '主页',
        component: () => import(/* webpackChunkName: "about" */ '../views/home/index'),
      },
      {
        path: '/user',
        name: '用户管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/index'),
      },
      {
        path: '/pet',
        name: '宠物信息管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/pet/index'),
      },
      {
        path: '/order',
        name: '订单管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/order/index'),
      },
      {
        path: '/evaluate',
        name: '评价管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/evaluate/index'),
      },
      {
        path: '/statement',
        name: '申述管理',
        component: () => import(/* webpackChunkName: "about" */ '../views/statement/index'),
      },
      {
        path: "/modifyPassword",
        name: "修改密码",
        component: () => import("../views/modifyPassword/index"),
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/login')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
